package manager

import (
	"time"

	"gitcode.com/G-YT/baoyou/server/global"
	"gorm.io/datatypes"
)

// MessageNotice 每日消息提醒聚合表
type MessageNotice struct {
	global.GvaModel
	HmID          uint           `json:"hm_id" gorm:"column:hm_id;index:idx_hm_user_day,unique;comment:健管师ID"`
	UserID        uint           `json:"user_id" gorm:"column:user_id;index:idx_hm_user_day,unique;comment:用户ID"`
	Day           time.Time      `json:"day" gorm:"column:day;index:idx_hm_user_day,unique;comment:自然日(东八区)"`
	Messages      datatypes.JSON `json:"messages" gorm:"column:messages;type:json;comment:当日消息JSON数组"`
	Status        uint           `json:"status" gorm:"column:status;default:0;comment:是否已读(0未读,1已读)"`
	HealthManager HealthManager  `json:"healthManager" gorm:"->;foreignKey:HmID;references:HmID"`
}

func (MessageNotice) TableName() string { return "by_message_notice" }
